package org.hxzon.demo.jt.logsearcher.web.components;

import java.util.List;

import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.annotations.BeginRender;
import org.apache.tapestry5.annotations.Parameter;
import org.hxzon.demo.jt.logsearcher.util.LogList;

public class SearchResult {

    @Parameter
    private List<LogList> value;

    @BeginRender
    void beginRender(MarkupWriter writer) {
        for (LogList logList : value) {
            writer.element("table");
            writer.element("tr", "class", "indexName");
            writer.element("th");
            writer.write("索引名：" + logList.getIndexName());
            writer.end();//th
            writer.end();//tr
            for (String log : logList) {
                writer.element("tr", "class", "log");
                writer.element("td");
                //writer.write(log);
                writer.writeRaw(log);
                writer.end();//td
                writer.end();//tr
            }
            writer.end();//table
        }
    }
}
